<?php

namespace common\model;

use think\model\RelationModel;

class CountPendingModel extends RelationModel
{

    //自动验证
    protected $_validate = [
        ['type', '', '', self::MUST_VALIDATE, 'require', self::MODEL_INSERT],//必须字段
        ['type', ['assign_task', 'review_submit', 'review_submit_feedback'], '', self::EXISTS_VALIDATE, 'in'],
        ['type,project_id,episode_id,step_id', '', '', self::MUST_VALIDATE, 'unique', '', 'design'],
    ];

    //自动完成
    protected $_auto = [
        ['updated', 'time', self::MODEL_BOTH, 'function'],
        ['created', 'time', self::MODEL_INSERT, 'function']
    ];
}
